package com.fmdj.cst.service.impl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.fmdj.cst.db.dao.CustomerCarDao;
import com.fmdj.cst.db.pojo.CustomerCarEntity;
import com.fmdj.cst.service.CustomerCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;

@Service
public class CustomerCarServiceImpl implements CustomerCarService {

    @Autowired
    private CustomerCarDao customerCarDao;
    @Override
    @Transactional
    @LcnTransaction
    public int insert(CustomerCarEntity entity) {
        return customerCarDao.insert(entity);
    }

    @Override
    public ArrayList<HashMap> selectCarList(long customerId) {
        return customerCarDao.selectCustomerCarList(customerId);
    }

    @Transactional
    @LcnTransaction
    @Override
    public int deleteCustomerCarById(long id) {
        return customerCarDao.deleteCustomerCarById(id);
    }
}
